Coding And Cryptography
Coding And Cryptography
A2.9
Part II, 2001 comment(i) Give brief answers to the following questions.
(a) What is a stream cypher?
(b) Explain briefly why a one-time pad is safe if used only once but becomes unsafe if used many times.
(c) What is a feedback register of length ? What is a linear feedback register of length
(d) A cypher stream is given by a linear feedback register of known length . Show that, given plain text and cyphered text of length , we can find the complete cypher stream.
(e) State and prove a similar result for a general feedback register.
(ii) Describe the construction of a Reed-Muller code. Establish its information rate and its weight
A1.10
Part II, 2001 comment(i) Explain briefly how and why a signature scheme is used. Describe the el Gamal scheme,
(ii) Define a cyclic code. Define the generator of a cyclic code and show that it exists. Prove a necessary and sufficient condition for a polynomial to be the generator of a cyclic code of length .
What is the code? Show that the code associated with , where is a root of in an appropriate field, is Hamming's original code.
A2.9
Part II, 2002 comment(i) Explain the idea of public key cryptography. Give an example of a public key system, explaining how it works.
(ii) What is a general feedback register of length with initial fill ? What is the maximal period of such a register, and why? What does it mean for such a register to be linear?
Describe and justify the Berlekamp-Massey algorithm for breaking a cypher stream arising from a general linear feedback register of unknown length.
Use the Berlekamp-Massey algorithm to find a linear recurrence in with first eight terms .
A1.10
Part II, 2002 comment(i) Describe the original Hamming code of length 7 . Show how to encode a message word, and how to decode a received word involving at most one error. Explain why the procedure works.
(ii) What is a linear binary code? What is its dual code? What is a cyclic binary code? Explain how cyclic binary codes of length correspond to polynomials in dividing . Show that the dual of a cyclic code of length is cyclic of length .
Using the factorization
in , find all cyclic binary codes of length 7 . Identify those which are Hamming codes and their duals. Justify your answer.
A2.9
Part II, 2003 comment(i) Answer the following questions briefly but clearly.
(a) How does coding theory apply when the error rate ?
(b) Give an example of a code which is not a linear code.
(c) Give an example of a linear code which is not a cyclic code.
(d) Give an example of a general feedback register with output , and initial fill , such that
for all .
(e) Explain why the original Hamming code can not always correct two errors.
(ii) Describe the Rabin-Williams scheme for coding a message as modulo a certain . Show that, if is chosen appropriately, breaking this code is equivalent to factorising the product of two primes.
A1.10
Part II, 2003 comment(i) We work over the field of two elements. Define what is meant by a linear code of length . What is meant by a generator matrix for a linear code?
Define what is meant by a parity check code of length . Show that a code is linear if and only if it is a parity check code.
Give the original Hamming code in terms of parity checks and then find a generator matrix for it.
[You may use results from the theory of vector spaces provided that you quote them correctly.]
(ii) Suppose that and let be the largest information rate of any binary error correcting code of length which can correct errors.
Show that
where
[You may assume any form of Stirling's theorem provided that you quote it correctly.]
A2.9
Part II, 2004 comment(i) Describe how a stream cypher operates. What is a one-time pad?
A one-time pad is used to send the message which is encoded as 0101011. By mistake, it is reused to send the message which is encoded as 0100010. Show that is one of two possible messages, and find the two possibilities.
(ii) Describe the RSA system associated with a public key , a private key and the product of two large primes.
Give a simple example of how the system is vulnerable to a homomorphism attack. Explain how a signature system prevents such an attack. [You are not asked to give an explicit signature system.]
Explain how to factorise when and are known.
A1.10
Part II, 2004 comment(i) What is a linear code? What does it mean to say that a linear code has length and minimum weight ? When is a linear code perfect? Show that, if , there exists a perfect linear code of length and minimum weight 3 .
(ii) Describe the construction of a Reed-Muller code. Establish its information rate and minimum weight.
1.I.4J
Part II, 2005 commentBriefly describe the methods of Shannon-Fano and Huffman for economical coding. Illustrate both methods by finding decipherable binary codings in the case where messages are emitted with probabilities . Compute the expected word length in each case.
2.I.4J
Part II, 2005 commentWhat is a linear binary code? What is the weight of a linear binary code Define the bar product of two binary linear codes and , stating the conditions that and must satisfy. Under these conditions show that
2.II.12J
Part II, 2005 commentWhat does it means to say that is a linear feedback shift register? Let be a stream produced by such a register. Show that there exist with such that for all .
Explain and justify the Berlekamp-Massey method for 'breaking' a cipher stream arising from a linear feedback register of unknown length.
Let be three streams produced by linear feedback registers. Set
Show that is also a stream produced by a linear feedback register. Sketch proofs of any theorems that you use.
3.I.4J
Part II, 2005 commentBriefly explain how and why a signature scheme is used. Describe the el Gamal scheme.
3.II.12J
Part II, 2005 commentDefine a cyclic code. Define the generator and check polynomials of a cyclic code and show that they exist.
Show that Hamming's original code is a cyclic code with check polynomial . What is its generator polynomial? Does Hamming's original code contain a subcode equivalent to its dual?
4.I.4J
Part II, 2005 commentWhat does it mean to transmit reliably at rate through a binary symmetric channel (BSC) with error probability ? Assuming Shannon's second coding theorem, compute the supremum of all possible reliable transmission rates of a BSC. What happens if (i) is very small, (ii) , or (iii) ?
1.I.4G
Part II, 2006 commentDefine a linear feedback shift register. Explain the Berlekamp-Massey method for "breaking" a key stream produced by a linear feedback shift register of unknown length. Use it to find the feedback polynomial of a linear feedback shift register with output sequence
2.I.4G
Part II, 2006 commentLet and be alphabets of sizes and . What does it mean to say that an -ary code is decipherable? Show that if is decipherable then the word lengths satisfy
Find a decipherable binary code consisting of codewords 011, 0111, 01111, 11111, and three further codewords of length 2. How do you know the example you have given is decipherable?
2.II.12G
Part II, 2006 commentDefine a cyclic code. Show that there is a bijection between the cyclic codes of length , and the factors of in .
If is an odd integer then we can find a finite extension of that contains a primitive th root of unity . Show that a cyclic code of length with defining set has minimum distance at least . Show that if and then we obtain Hamming's original code.
[You may quote a formula for the Vandermonde determinant without proof.]
3.I.4G
Part II, 2006 commentWhat does it mean to say that a binary code has length , size and minimum distance ? Let be the largest value of for which there exists an -code. Prove that
where .
3.II.12G
Part II, 2006 commentDescribe the RSA system with public key and private key . Briefly discuss the possible advantages or disadvantages of taking (i) or (ii) .
Explain how to factor when both the private key and public key are known.
Describe the bit commitment problem, and briefly indicate how RSA can be used to solve it.
4.I.4G
Part II, 2006 commentA binary erasure channel with erasure probability is a discrete memoryless channel with channel matrix
State Shannon's second coding theorem, and use it to compute the capacity of this channel.
1.I.4G
Part II, 2007 commentLet and be alphabets of sizes and . What does it mean to say that is a decipherable code? State the inequalities of Kraft and Gibbs, and deduce that if letters are drawn from with probabilities then the expected word length is at least .
2.I.4G
Part II, 2007 commentBriefly explain how and why a signature scheme is used. Describe the El Gamal scheme.
1.II.11G
Part II, 2007 commentDefine the bar product of linear codes and , where is a subcode of . Relate the rank and minimum distance of to those of and . Show that if denotes the dual code of , then
Using the bar product construction, or otherwise, define the Reed-Muller code for . Show that if , then the dual of is again a Reed-Muller code.
- Part II, 2007
commentCompute the rank and minimum distance of the cyclic code with generator polynomial and parity-check polynomial . Now let be a root of in the field with 8 elements. We receive the word . Verify that , and hence decode using minimum-distance decoding.
2.II.11G
Part II, 2007 commentDefine the capacity of a discrete memoryless channel. State Shannon's second coding theorem and use it to show that the discrete memoryless channel with channel matrix
has capacity .
4.I.4G
Part II, 2007 commentWhat is a linear feedback shift register? Explain the Berlekamp-Massey method for recovering the feedback polynomial of a linear feedback shift register from its output. Illustrate in the case when we observe output
1.I.4G
Part II, 2008 commentDefine the entropy of a random variable that takes no more than different values. What are the maximum and the minimum values for the entropy for a fixed value of ? Explain when the maximum and minimum are attained. You should prove any inequalities that you use.
2.I.4G
Part II, 2008 commentDescribe briefly the Shannon-Fano and Huffman binary codes for a finite alphabet. Find examples of such codes for the alphabet when the four letters are taken with probabilities and respectively.
1.II.12G
Part II, 2008 commentState Shannon's Noisy Coding Theorem for a binary symmetric channel.
Define the mutual information of two discrete random variables and . Prove that the mutual information is symmetric and non-negative. Define also the information capacity of a channel.
A channel transmits numbers chosen from the alphabet and has transition matrix
for a number with . Calculate the information capacity of the channel.
3.I.4G
Part II, 2008 commentDefine the Hamming code and prove that the minimum distance between two distinct code words is 3. Explain how the Hamming code allows one error to be corrected.
A new code is obtained by using the Hamming code for the first 7 bits and taking the last bit as a check digit on the previous 7 . Find the minimum distance between two distinct code words for this code. How many errors can this code detect? How many errors can it correct?
2.II.12G
Part II, 2008 commentDescribe the Rabin cipher with modulus , explaining how it can be deciphered by the intended recipient and why it is difficult for an interceptor to decipher it.
The Bursars' Committee decides to communicate using Rabin ciphers to maintain confidentiality. The secretary of the committee encrypts a message, thought of as a positive integer , using the Rabin cipher with modulus (with ) and publishes both the encrypted message and the modulus. A foolish bursar deciphers this message to read it but then encrypts it again using a Rabin cipher with a different modulus (with and publishes the newly encrypted message and . The president of CUSU, who happens to be a talented mathematician, knows that this has happened. Explain how the president can work out what the original message was using the two different encrypted versions.
Can the president of CUSU also decipher other messages sent out by the Bursars' Committee?
4.I.4G
Part II, 2008 commentWhat is a binary cyclic code of length ? What is the generator polynomial for such a cyclic code? Prove that the generator polynomial is a factor of over the field .
Find all the binary cyclic codes of length 5 .
Paper 4, Section I, H
Part II, 2009 commentWhat is a general feedback register? What is a linear feedback register? Give an example of a general feedback register which is not a linear feedback register and prove that it has the stated property.
By giving proofs or counterexamples, establish which, if any, of the following statements are true and which, if any, are false.
(i) Given two linear feedback registers, there always exist non-zero initial fills for which the outputs are identical.
(ii) If two linear feedback registers have different lengths, there do not exist non-zero initial fills for which the outputs are identical.
(iii) If two linear feedback registers have different lengths, there exist non-zero initial fills for which the outputs are not identical.
(iv) There exist two linear feedback registers of different lengths and non-zero initial fills for which the outputs are identical.
Paper 1, Section I, H
Part II, 2009 commentI am putting up my Christmas lights. If I plug in a set of bulbs and one is defective, none will light up. A badly written note left over from the previous year tells me that exactly one of my 10 bulbs is defective and that the probability that the th bulb is defective is .
(i) Find an explicit procedure for identifying the defective bulb in the least expected number of steps.
[You should explain your method but no proof is required.]
(ii) Is there a different procedure from the one you gave in (i) with the same expected number of steps? Either write down another procedure and explain briefly why it gives the same expected number or explain briefly why no such procedure exists.
(iii) Because I make such a fuss about each test, my wife wishes me to tell her the maximum number of trials that might be required. Will the procedure in (i) give the minimum ? Either write down another procedure and explain briefly why it gives a smaller or explain briefly why no such procedure exists.
Paper 3, Section I,
Part II, 2009 commentDefine a binary code of length 15 with information rate which will correct single errors. Show that it has the rate stated and give an explicit procedure for identifying the error. Show that the procedure works.
[Hint: You may wish to imitate the corresponding discussion for a code of length 7 .]
Paper 2, Section I,
Part II, 2009 commentKnowing that
and that 3953 is the product of two primes and , find and .
[You should explain your method in sufficient detail to show that it is reasonably general.]
Paper 2, Section II, H
Part II, 2009 commentDescribe the construction of the Reed-Miller code . Establish its information rate and minimum weight.
Show that every codeword in has even weight. By considering with and , or otherwise, show that . Show that, in fact,
Paper 1, Section II, H
Part II, 2009 comment(i) State and prove Gibbs' inequality.
(ii) A casino offers me the following game: I choose strictly positive numbers with . I give the casino my entire fortune and roll an -sided die. With probability the casino returns for . If I intend to play the game many times (staking my entire fortune each time) explain carefully why I should choose to maximise .
[You should assume and for each ]
(iii) Determine the appropriate . Let . Show that, if , then, in the long run with high probability, my fortune increases. Show that, if , the casino can choose in such a way that, in the long run with high probability, my fortune decreases. Is it true that, if , any choice of will ensure that, in the long run with high probability, my fortune decreases? Why?
Paper 1, Section I, H
Part II, 2010 commentExplain what is meant by saying that a binary code is a decodable code with words of length for . Prove the MacMillan inequality which states that, for such a code,
Paper 2, Section I,
Part II, 2010 commentDescribe the standard Hamming code of length 7 , proving that it corrects a single error. Find its weight enumeration polynomial.
Paper 3, Section I,
Part II, 2010 commentWhat is a linear code? What is a parity check matrix for a linear code? What is the minimum distance for a linear code
If and are linear codes having a certain relation (which you should specify), define the bar product . Show that
If has parity check matrix and has parity check matrix , find a parity check matrix for .
Paper 4, Section I, H
Part II, 2010 commentWhat is the discrete logarithm problem?
Describe the Diffie-Hellman key exchange system for two people. What is the connection with the discrete logarithm problem? Why might one use this scheme rather than just a public key system or a classical (pre-1960) coding system?
Extend the Diffie-Hellman system to people using transmitted numbers.
Paper 1, Section II, H
Part II, 2010 commentState and prove Shannon's theorem for the capacity of a noisy memoryless binary symmetric channel, defining the terms you use.
[You may make use of any form of Stirling's formula and any standard theorems from probability, provided that you state them exactly.]
Paper 2, Section II, H
Part II, 2010 commentThe Van der Monde matrix is the matrix with th entry . Find an expression for as a product. Explain why this expression holds if we work modulo a prime.
Show that modulo if , and that there exist such that . By using Wilson's theorem, or otherwise, find the possible values of modulo .
The Dark Lord Y'Trinti has acquired the services of the dwarf Trigon who can engrave pairs of very large integers on very small rings. The Dark Lord wishes Trigon to engrave rings in such a way that anyone who acquires of the rings and knows the Prime Perilous can deduce the Integer of Power, but owning rings will give no information whatsoever. The integers and are very large and . Advise the Dark Lord.
For reasons to be explained in the prequel, Trigon engraves an st ring with random integers. A band of heroes (who know the Prime Perilous and all the information contained in this question) set out to recover the rings. What, if anything, can they say, with very high probability, about the Integer of Power if they have rings (possibly including the fake)? What can they say if they have rings? What if they have rings?
Paper 1, Section I, G
Part II, 2011 commentI think of an integer with . Explain how to find using twenty questions (or less) of the form 'Is it true that ?' to which I answer yes or no.
I have watched a horse race with 15 horses. Is it possible to discover the order in which the horses finished by asking me twenty questions to which I answer yes or no?
Roughly how many questions of the yes/no type are required to discover the order in which horses finished if is large?
[You may assume that I answer honestly.]
Paper 2, Section I, G
Part II, 2011 commentI happen to know that an apparently fair coin actually has probability of heads with . I play a very long sequence of games of heads and tails in which my opponent pays me back twice my stake if the coin comes down heads and takes my stake if the coin comes down tails. I decide to bet a proportion of my fortune at the end of the th game in the st game. Determine, giving justification, the value maximizing the expected logarithm of my fortune in the long term, assuming I use the same at each game. Can it be actually disadvantageous for me to choose an (in the sense that I would be better off not playing)? Can it be actually disadvantageous for me to choose an ?
[Moral issues should be ignored.]
Paper 3, Section I, G
Part II, 2011 commentWhat is the rank of a binary linear code What is the weight enumeration polynomial of
Show that where is the rank of . Show that for all and if and only if .
Find, with reasons, the weight enumeration polynomial of the repetition code of length , and of the simple parity check code of length .
Paper 4, Section I, G
Part II, 2011 commentDescribe a scheme for sending messages based on quantum theory which is not vulnerable to eavesdropping. You may ignore engineering problems.
Paper 1, Section II,
Part II, 2011 commentDescribe the Rabin-Williams coding scheme. Show that any method for breaking it will enable us to factorise the product of two primes.
Explain how the Rabin-Williams scheme can be used for bit sharing (that is to say 'tossing coins by phone').
Paper 2, Section II, G
Part II, 2011 commentDefine a cyclic code. Show that there is a bijection between the cyclic codes of length and the factors of over the field of order 2 .
What is meant by saying that is a primitive th root of unity in a finite field extension of ? What is meant by saying that is a BCH code of length with defining set ? Show that such a code has minimum distance at least .
Suppose that is a finite field extension of in which factorises into linear factors. Show that if is a root of then is a primitive 7 th root of unity and is also a root of . Quoting any further results that you need show that the code of length 7 with defining set is the Hamming code.
[Results on the Vandermonde determinant may be used without proof provided they are quoted correctly.]
Paper 4, Section I, G
Part II, 2012 commentDescribe the BB84 protocol for quantum key exchange.
Suppose we attempt to implement the BB84 protocol but cannot send single photons. Instead we send photons at a time all with the same polarization. An enemy can separate one of these photons from the other . Explain briefly how the enemy can intercept the key exchange without our knowledge.
Show that an enemy can find our common key if . Can she do so when (with suitable equipment)?
Paper 3, Section , G
Part II, 2012 commentDescribe the RSA system with public key and private key . Give a simple example of how the system is vulnerable to a homomorphism attack. Explain how a signature system prevents such an attack.
Paper 2, Section I, G
Part II, 2012 commentWhat is a (binary) linear code? What does it mean to say that a linear code has length and minimum weight ? When is a linear code perfect? Show that, if , there exists a perfect linear code of length and minimum weight 3 .
Paper 1, Section I, G
Part II, 2012 commentLet and be alphabets of sizes and a respectively. What does it mean to say that is a decodable code? State Kraft's inequality.
Suppose that a source emits letters from the alphabet , each letter occurring with (known) probability . Let be the codeword-length random variable for a decodable code , where . It is desired to find a decodable code that minimizes the expected value of . Establish the lower bound , and characterise when equality occurs. [Hint. You may use without proof the Cauchy-Schwarz inequality, that (for positive )
with equality if and only if for all i.]
Paper 2, Section II, G
Part II, 2012 commentWhat does it mean to say that is a linear feedback shift register? Let be a stream produced by such a register. Show that there exist with such that for all .
Describe and justify the Berlekamp-Massey method for 'breaking' a cipher stream arising from a linear feedback register of unknown length.
Let be three streams produced by linear feedback registers. Set
Show that is also a stream produced by a linear feedback register. Sketch proofs of any theorems you use.
Paper 1, Section II, 12G
Part II, 2012 commentDefine a cyclic binary code of length .
Show how codewords can be identified with polynomials in such a way that cyclic binary codes correspond to ideals in the polynomial ring with a suitably chosen multiplication rule.
Prove that any cyclic binary code has a unique generator, that is, a polynomial of minimum degree, such that the code consists of the multiples of this polynomial. Prove that the rank of the code equals , and show that divides .
Show that the repetition and parity check codes are cyclic, and determine their generators.
Paper 4, Section I,
Part II, 2013 commentDescribe how a stream cipher works. What is a one-time pad?
A one-time pad is used to send the message which is encoded as 0101011. In error, it is reused to send the message which is encoded as 0100010 . Show that there are two possibilities for the substring , and find them.
Paper 3, Section I, H
Part II, 2013 commentDescribe briefly the Rabin cipher with modulus , explaining how it can be deciphered by the intended recipient and why it is difficult for an eavesdropper to decipher it.
The Cabinet decides to communicate using Rabin ciphers to maintain confidentiality. The Cabinet Secretary encrypts a message, represented as a positive integer , using the Rabin cipher with modulus (with ) and publishes both the encrypted message and the modulus. The Defence Secretary deciphers this message to read it but then foolishly encrypts it again using a Rabin cipher with a different modulus (with and publishes the newly encrypted message and . Mr Rime (the Leader of the Opposition) knows this has happened. Explain how Rime can work out what the original message was using the two different encrypted versions.
Can Rime decipher other messages sent out by the Cabinet using the original modulus ?
Paper 2, Section I, H
Part II, 2013 commentLet denote the maximum size of a binary code of length with minimum distance . For fixed with , let . Show that
where .
[You may assume the GSV and Hamming bounds and any form of Stirling's theorem provided you state them clearly.]
Paper 1, Section I, H
Part II, 2013 commentA binary Huffman code is used for encoding symbols occurring with respective probabilities where . Let be the length of a shortest codeword and the length of a longest codeword. Determine the maximal and minimal values of each of and , and find binary trees for which they are attained.
Paper 2, Section II, H
Part II, 2013 commentDefine a BCH code of length , where is odd, over the field of 2 elements with design distance . Show that the minimum weight of such a code is at least . [Results about the van der Monde determinant may be quoted without proof, provided they are stated clearly.]
Consider a BCH code of length 31 over the field of 2 elements with design distance 8 . Show that the minimum distance is at least 11. [Hint: Let be a primitive element in the field of elements, and consider the minimal polynomial for certain powers of
Paper 1, Section II, H
Part II, 2013 commentDefine the bar product of binary linear codes and , where is a subcode of . Relate the rank and minimum distance of to those of and and justify your answer. Show that if denotes the dual code of , then
Using the bar product construction, or otherwise, define the Reed-Muller code for . Show that if , then the dual of is again a Reed-Muller code.
Paper 4, Section I, I
Part II, 2014 commentExplain what is meant by a Bose-Ray Chaudhuri-Hocquenghem (BCH) code with design distance . Prove that, for such a code, the minimum distance between code words is at least . How many errors will the code detect? How many errors will it correct?
Paper 3, Section I, I
Part II, 2014 commentLet be a random variable that takes values in the finite alphabet . Prove that there is a decodable binary code that satisfies
where is the length of the code word and is the entropy of .
Is it always possible to find such a code with Justify your answer.
Paper 2, Section , I
Part II, 2014 commentLet be a decodable binary code defined on a finite alphabet . Let be the length of the code word . Prove that
Show that, for the decodable code described above, there is a prefixfree code with each code word having length . [You may use, without proof, any standard results from the course.]
Paper 1, Section I,
Part II, 2014 commentState and prove Gibbs' inequality.
Show that, for a pair of discrete random variables and , each taking finitely many values, the joint entropy satisfies
with equality precisely when and are independent.
Paper 2, Section II, I
Part II, 2014 commentWhat is the information capacity of a memoryless, time-independent channel? Compute the information capacity of a binary symmetric channel with probability of error. Show the steps in your computation.
Binary digits are transmitted through a noisy channel, which is memoryless and time-independent. With probability the digit is corrupted and noise is received, otherwise the digit is transmitted unchanged. So, if we denote the input by 0 and 1 and the output as and 1 with denoting the noise, the transition matrix is
Compute the information capacity of this channel.
Explain how to code a message for transmission through the channel described above, and how to decode it, so that the probability of error for each bit is arbitrarily small.
Paper 1, Section II, I
Part II, 2014 commentDescribe, briefly, either the RSA or the Elgamal public key cipher. You should explain, without proof, why it is believed to be difficult to break the cipher you describe.
How can such a cipher be used to sign messages? You should explain how the intended recipient of the message can (a) know from whom it came; (b) know that the message has not been changed; and (c) demonstrate that the sender must have signed it.
Let be friendly individuals each of whom has a public key cipher. wishes to send a message to by passing it first to , then passes it to to , until finally it is received by . At each stage the message can be modified to show from whom it was received and to whom it is sent. Devise a way in which these modifications can be made so that can be confident both of the content of the original message and that the message has been passed through the intermediaries in that order and has not been modified by an enemy agent. Assume that it takes a negligible time to transmit a message from to for each , but the time needed to modify a message is not negligible.
Paper 4, Section I, G
Part II, 2015 commentExplain how to construct binary Reed-Muller codes. State and prove a result giving the minimum distance for each such Reed-Muller code.
Paper 3, Section I, G
Part II, 2015 commentLet be a random variable that takes each value in the finite alphabet with probability . Show that, if each is an integer greater than 0 and , then there is a decodable binary code with each codeword having length .
Prove that, for any decodable code , we have
where is the entropy of the random variable . When is there equality in this inequality?
Paper 2, Section I, G
Part II, 2015 commentA random variable takes values in the alphabet with probabilities and . Calculate the entropy of .
Define what it means for a code for a general finite alphabet to be optimal. Find such a code for the distribution above and show that there are optimal codes for this distribution with differing lengths of codeword.
[You may use any results from the course without proof. Note that .]
Paper 1, Section I,
Part II, 2015 commentLet be a finite alphabet. Explain what is meant by saying that a binary code has minimum distance . If is such a binary code with minimum distance , show that is error-detecting and error-correcting.
Show that it is possible to construct a code that has minimum distance for any integer .
Paper 1, Section II, G
Part II, 2015 commentDefine the Hamming code. Show that it is a perfect, linear, 1-error correcting code.
I wish to send a message through a noisy channel to a friend. The message consists of a large number of letters from a 16 -letter alphabet . When my friend has decoded the message, she can tell whether there have been any errors. If there have, she asks me to send the message again and this is repeated until she has received the message without error. For each individual binary digit that is transmitted, there is independently a small probability of an error.
(a) Suppose that I encode my message by writing each letter as a 4-bit binary string. The whole message is then bits long. What is the probability that the entire message is transmitted without error? How many times should I expect to transmit the message until my friend receives it without error?
(b) As an alternative, I use the Hamming code to encode each letter of as a 7-bit binary string. What is the probability that my friend can decode a single 7-bit string correctly? Deduce that the probability that the entire message is correctly decoded is given approximately by
Which coding method is better?
Paper 2, Section II, G
Part II, 2015 commentBriefly describe the public key cipher.
Just before it went into liquidation, the Internet Bank decided that it wanted to communicate with each of its customers using an RSA cipher. So, it chose a large modulus , which is the product of two large prime numbers, and chose encrypting exponents and decrypting exponents for each customer . The bank published and and sent the decrypting exponent secretly to customer . Show explicitly that the cipher can be broken by each customer.
The bank sent out the same message to each customer. I am not a customer of the bank but have two friends who are and I notice that their published encrypting exponents are coprime. Explain how I can find the original message. Can I break the cipher?
Paper 1, Section I, G
Part II, 2016 commentFind the average length of an optimum decipherable binary code for a source that emits five words with probabilities
Show that, if a source emits words (with ), and if are the lengths of the codewords in an optimum encoding over the binary alphabet, then
[You may assume that an optimum encoding can be given by a Huffman encoding.]
Paper 2, Section I, G
Part II, 2016 commentShow that the binary channel with channel matrix
has capacity .
Paper 3, Section I,
Part II, 2016 commentDescribe in words the unicity distance of a cryptosystem.
Denote the cryptosystem by , in the usual way, and let and be random variables and . The unicity distance is formally defined to be the least such that . Derive the formula
where , and is the alphabet of the ciphertext. Make clear any assumptions you make.
The redundancy of a language is given by . If a language has zero redundancy what is the unicity of any cryptosystem?
Paper 4, Section I, G
Part II, 2016 commentDescribe the Rabin-Williams scheme for coding a message as modulo a certain . Show that, if is chosen appropriately, breaking this code is equivalent to factorising the product of two primes.
Paper 1, Section II, G
Part II, 2016 commentWhat does it mean to say a binary code has length , size and minimum distance d?
Let be the largest value of for which there exists an -code. Prove that
where
Another bound for is the Singleton bound given by
Prove the Singleton bound and give an example of a linear code of length that satisfies .
Paper 2, Section II, G
Part II, 2016 commentDefine a code of length , where is odd, over the field of 2 elements with design distance . Show that the minimum weight of such a code is at least . [Results about the Vandermonde determinant may be quoted without proof, provided they are stated clearly.]
Let be a root of . Let be the code of length 15 with defining set . Find the generator polynomial of and the rank of . Determine the error positions of the following received words:
(i) ,
(ii) .
Paper 4, Section I,
Part II, 2019 comment(a) Describe Diffie-Hellman key exchange. Why is it believed to be a secure system?
(b) Consider the following authentication procedure. Alice chooses public key for the Rabin-Williams cryptosystem. To be sure we are in communication with Alice we send her a 'random item' . On receiving , Alice proceeds to decode using her knowledge of the factorisation of and finds a square root of . She returns to us and we check . Is this authentication procedure secure? Justify your answer.
Paper 3, Section I, G
Part II, 2019 commentWhat does it mean to transmit reliably at rate through a binary symmetric channel with error probability ?
Assuming Shannon's second coding theorem (also known as Shannon's noisy coding theorem), compute the supremum of all possible reliable transmission rates of a BSC. Describe qualitatively the behaviour of the capacity as varies. Your answer should address the following cases,
(i) is small,
(ii) ,
(iii) .
Paper 2, Section I, G
Part II, 2019 commentDefine the binary Hamming code of length for . Define a perfect code. Show that a binary Hamming code is perfect.
What is the weight of the dual code of a binary Hamming code when
Paper 1, Section I, G
Part II, 2019 commentLet and be discrete random variables taking finitely many values. Define the conditional entropy . Suppose is another discrete random variable taking values in a finite alphabet, and prove that
[You may use the equality and the inequality
State and prove Fano's inequality.
Paper 1, Section II, G
Part II, 2019 commentWhat does it mean to say that is a binary linear code of length , rank and minimum distance ? Let be such a code.
(a) Prove that .
Let be a codeword with exactly non-zero digits.
(b) Prove that puncturing on the non-zero digits of produces a code of length and minimum distance for some .
(c) Deduce that .
Paper 2, Section II, G
Part II, 2019 commentDescribe the Huffman coding scheme and prove that Huffman codes are optimal.
Are the following statements true or false? Justify your answers.
(i) Given messages with probabilities a Huffman coding will assign a unique set of word lengths.
(ii) An optimal code must be Huffman.
(iii) Suppose the words of a Huffman code have word lengths . Then
[Throughout this question you may assume that a decipherable code with prescribed word lengths exists if and only if there is a prefix-free code with the same word lengths.]
Paper 1, Section I, I
Part II, 2020 comment(a) Briefly describe the methods of Shannon-Fano and of Huffman for the construction of prefix-free binary codes.
(b) In this part you are given that , and .
Let . For , suppose that the probability of choosing is .
(i) Find a Shannon-Fano code for this system and the expected word length.
(ii) Find a Huffman code for this system and the expected word length.
(iii) Verify that Shannon's noiseless coding theorem is satisfied in each case.
Paper 2, Section I, I
Part II, 2020 comment(a) Define the information capacity of a discrete memoryless channel (DMC).
(b) Consider a DMC where there are two input symbols, and , and three output symbols, and . Suppose each input symbol is left intact with probability , and transformed into a with probability .
(i) Write down the channel matrix, and calculate the information capacity.
(ii) Now suppose the output is further processed by someone who cannot distinguish between and , so that the channel matrix becomes
Calculate the new information capacity.
Paper 3, Section I, I
Part II, 2020 commentLet and be very large positive integers with a prime and . The Chair of the Committee is able to inscribe pairs of very large integers on discs. The Chair wishes to inscribe a collection of discs in such a way that any Committee member who acquires of the discs and knows the prime can deduce the integer , but owning discs will give no information whatsoever. What strategy should the Chair follow?
[You may use without proof standard properties of the determinant of the Vandermonde matrix.]
Paper 4, Section I, I
Part II, 2020 comment(a) What does it mean to say that a cipher has perfect secrecy? Show that if a cipher has perfect secrecy then there must be at least as many possible keys as there are possible plaintext messages. What is a one-time pad? Show that a one-time pad has perfect secrecy.
(b) I encrypt a binary sequence using a one-time pad with key sequence I transmit to you. Then, by mistake, I also transmit to you. Assuming that you know I have made this error, and that my message makes sense, how would you go about finding my message? Can you now decipher other messages sent using the same part of the key sequence? Briefly justify your answer.
Paper 1, Section II, I
Part II, 2020 comment(a) What does it mean to say that a binary code has length , size and minimum distance d?
Let be the largest value of for which there exists a binary -code.
(i) Show that .
(ii) Suppose that . Show that if a binary -code exists, then a binary -code exists. Deduce that .
(iii) Suppose that . Show that .
(b) (i) For integers and with , show that
For the remainder of this question, suppose that is a binary -code. For codewords of length , we define to be the word with addition modulo
(ii) Explain why the Hamming distance is the number of 1 s in .
(iii) Now we construct an array whose rows are all the words for pairs of distinct codewords . Show that the number of in is at most
Show also that the number of in is at least .
(iv) Using the inequalities derived in part(b) (iii), deduce that if is even and then
Paper 2, Section II, I
Part II, 2020 commentLet be the Hamming code of weight 3 , where . Let be the parity-check matrix of . Let be the number of codewords of weight in .
(i) Show that for any two columns and of there exists a unique third column such that . Deduce that .
(ii) Show that contains a codeword of weight .
(iii) Find formulae for and . Justify your answer in each case.
Paper 1, Section I,
Part II, 2021 commentLet be an code. Define the parameters and . In each of the following cases define the new code and give its parameters.
(i) is the parity extension of .
(ii) is the punctured code (assume ).
(iii) is the shortened code (assume ).
Let . Suppose the parity extension of is transmitted through a binary symmetric channel where is the probability of a single-bit error in the channel. Calculate the probability that an error in the transmission of a single codeword is not noticed.
Paper 2, Section I, K
Part II, 2021 commentState Shannon's noisy coding theorem for a binary symmetric channel, defining the terms involved.
Suppose a channel matrix, with output alphabet of size , is such that the entries in each row are the elements of the set in some order. Further suppose that all columns are permutations of one another. Show that the channel's information capacity is given by
Show that the information capacity of the channel matrix
is given by .
Paper 3, Section I, K
Part II, 2021 commentLet . Define the Hamming code of length . Explain what it means to be a perfect code and show that is a perfect code.
Suppose you are using the Hamming code of length and you receive the message of length . How would you decode this message using minimum distance decoding? Explain why this leads to correct decoding if at most one channel error has occurred.
Paper 4 , Section I,
Part II, 2021 commentDescribe the Rabin scheme for coding a message as modulo a certain integer .
Describe the RSA encryption scheme with public key and private key .
[In both cases you should explain how you encrypt and decrypt.]
Give an advantage and a disadvantage that the Rabin scheme has over the RSA scheme.
Paper 1, Section II,
Part II, 2021 commentLet be a finite alphabet and a random variable that takes each value with probability . Define the entropy of .
Suppose and is a decipherable code. Write down an expression for the expected word length of .
Prove that the minimum expected word length of a decipherable code satisfies
[You can use Kraft's and Gibbs' inequalities as long as they are clearly stated.]
Suppose a decipherable binary code has word lengths . Show that
Suppose is a source that emits sourcewords and is the probability that is emitted, where . Let and for . Let for . Now define a code by where is the (fractional part of the) binary expansion of to decimal places. Prove that this defines a decipherable code.
What does it mean for a code to be optimal? Is the code defined in the previous paragraph in terms of the necessarily optimal? Justify your answer.
Paper 2, Section II,
Part II, 2021 comment(a) Define what it means to say that is a binary cyclic code. Explain the bijection between the set of binary cyclic codes of length and the factors of in .
(b) What is a linear feedback shift register?
Suppose that is a linear feedback shift register. Further suppose and is a positive integer such that . Let be the matrix . Considering as a parity check matrix of a code , show that is a binary cyclic code.
(c) Suppose that is a binary cyclic code. Prove that, if does not contain the codeword , then all codewords in have even weight.